//
//  OrderInfoTableViewCell.swift
//  OnceNectar
//
//  Created by 吴凌 on 2018/7/30.
//  Copyright © 2018年 com.inwhoop. All rights reserved.
//

import UIKit
protocol OrderInfoTableViewCellDelegate: NSObjectProtocol {
    func btn1Click(model:myOrderModel)
    func btn2Click(model:myOrderModel)
    func btn3Click(model:myOrderModel)
    func copyClick(orderNo:String)
}
class OrderInfoTableViewCell: UITableViewCell {
    @IBOutlet weak var paytextLabel: UILabel!
    @IBOutlet weak var btn1: UIButton!
    
    @IBOutlet weak var btn3: UIButton!
    @IBOutlet weak var btn2: UIButton!
    @IBOutlet weak var payAmount: UILabel!
    @IBOutlet weak var trainAmount: UILabel!
    @IBOutlet weak var payType: UILabel!
    @IBOutlet weak var amount: UILabel!
    @IBOutlet weak var invoiceType: UILabel!
    @IBOutlet weak var orderTime: UILabel!
    @IBOutlet weak var orderNo: UILabel!
    var model:myOrderModel?
    weak var delegate: OrderInfoTableViewCellDelegate?
    override func awakeFromNib() {
        super.awakeFromNib()
        btn1.layer.cornerRadius = btn1.height / 2
    
        btn1.layer.borderColor = UIColor(hex: 0xAAAAAA).cgColor
        btn1.layer.borderWidth = 1
        
        btn2.layer.cornerRadius = btn2.height / 2
        btn2.layer.borderColor = UIColor(hex: 0xAAAAAA).cgColor
        btn2.layer.borderWidth = 1
        
        btn3.layer.cornerRadius = btn3.height / 2
        btn3.layer.borderColor = UIColor(hex: 0xAAAAAA).cgColor
        btn3.layer.borderWidth = 1
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

    }
    @IBAction func copyClick(_ sender: Any) {
        self.delegate?.copyClick(orderNo: (model?.orderNumber!)!)
    }
    @IBAction func btn3Click(_ sender: Any) {
        self.delegate?.btn3Click(model: self.model!)
    }
    
    @IBAction func btn2Click(_ sender: Any) {
        self.delegate?.btn2Click(model: self.model!)
    }
    @IBAction func btn1Click(_ sender: Any) {
        self.delegate?.btn1Click(model: self.model!)
    }
}
